Skip to content

feat(checkout): CHECKOUT-10448 Improve Billing Address Options for Multi-shipping - #3454

Merged
bc-peng merged 7 commits into
masterfrom
BILLING-ADDRESS-PLUS
Nov 11, 2026
Merged

bc-peng merged 7 commits into
masterfrom
BILLING-ADDRESS-PLUS

Conversation

@bc-peng

@bc-peng bc-peng commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

What/Why?

When using multi-shipping in the enhanced theme, the billing address dropdown lists consignment addresses, so:

  • shoppers can pick one or enter a new address.

This feature is only available to:

  • All B2C guest/sign-in customers.

and not available to:

  • B2B customer.
  • PayPalFastlane.

Rollout/Rollback

No experiment. Roll back by reverting this commit.

New experiments

N/A

Testing

Guest checkout in the enhanced theme sees the newly entered address in the billing address dropdown

Screen.Recording.2026-11-10.at.15.07.53.mov

Guest checkout in the classic theme does not see this feature

image

B2B customer does not see this feature

Screen.Recording.2026-11-09.at.13.03.36.mov

Note

Medium Risk
Touches checkout billing address selection and persistence for multi-shipping and guest/Fastlane edge cases, where incorrect options or payload shaping could block or mis-assign billing.

Overview
Multi-shipping billing now merges consignment shipping addresses into the billing address picker (via getConsignmentAddressOptions), so B2C shoppers can choose a ship-to address or enter a new one. Consignment options are skipped for B2B company address books and for PayPal Fastlane guests who already have Fastlane addresses; selecting a consignment address strips placeholder id/type before persistence.

The billing step UI is tightened: when there is no valid saved billing address, the dropdown shows an “Enter or select an address” placeholder and hides the form until the shopper picks Add new, selects an option, or fails validation on submit (which then reveals the fields). A new locale string backs the placeholder.

Coverage adds unit tests for consignment option building and a large address book suite on PaymentBillingForm (multi-ship, guest, Fastlane, B2B).

Reviewed by Cursor Bugbot for commit cac906e. Bugbot is set up for automated code reviews on this repo. Configure here.

@bc-peng

bc-peng commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

cursor review

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@bc-peng
bc-peng marked this pull request as ready for review November 9, 2026 02:15
@bc-peng
bc-peng requested a review from a team as a code owner November 9, 2026 02:15

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit de6cbc9. Configure here.

@richapatel1510 richapatel1510 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you update the description to match the smaller scope relating only multi address shipping? Also, the rollout section says registered shoppers only, but its available guests too, also only on enhanced checkout

const rawBillingAddresses =
isGuest && isPayPalFastlaneEnabled ? paypalFastlaneAddresses : customer.addresses;

const billingAddresses = rawBillingAddresses.map((address) =>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a separate hook for this? The form already has isUsingMultiShipping, customer, config and cart, so I think we could just add consignments to the existing selector and do something like:

const consignmentAddresses =
    isUsingMultiShipping && !hasCompanyAddressBook && !hasFastlaneAddresses
        ? uniqWith(
              consignments.map(({ shippingAddress }) => omit(shippingAddress, 'email')),
              isEqualAddress,
          )
              .filter((a) => !baseAddresses.some((b) => isEqualAddress(a, b)))
              .map((a, i) => ({ ...a, id: -(i + 1), type: 'residential' }))
        : [];
const billingAddresses = [...baseAddresses, ...consignmentAddresses];

If needed we can create a helper getConsignmentAddressOptions to get the consignment addresses as option

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected the description.
Updated the solution as suggested.
One more thing, B2C signed-in customers always have consignment addresses in the billing dropdown because we save a new address when creating a consignment.
02d9cac

Comment on lines +137 to +141
const isAddressSelectVisible = hasAddresses && !shouldRenderStaticAddress;
const shouldShowAddressForm =
!restrictManualAddressEntry &&
!hasValidCustomerAddress &&
(!isAddressSelectVisible || isEnteringNewAddress || !!billingAddress?.address1);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have we tested how it works for single shipping now, looks like it will hide the billing form for single shipping address as well when billing is not same as shipping

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the single shipping works as expected. !isAddressSelectVisible is true in this case.

Screen.Recording.2026-11-10.at.16.54.21.mov

const customerAddresses = customer?.addresses;
const isPayPalFastlaneGuest = !!customer?.isGuest && isPayPalFastlaneEnabled;
const hasPayPalFastlaneAddresses = isPayPalFastlaneGuest && paypalFastlaneAddresses.length > 0;
const isMultiShippingEnabled = !!config?.checkoutSettings.hasMultiShippingEnabled;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the hasMultiShippingEnabled check? If the order actually ships to multiple addresses, the store must have multi-shipping enabled anyway.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, checking this is indeed unnecessary. Removed.

Comment on lines +116 to +125
const consignmentAddresses =
shouldIncludeConsignmentAddresses && consignments
? getConsignmentAddressOptions(consignments, baseAddresses).map((address) =>
decodeAddressLabel(address, hasAddressLabel),
)
: [];
const billingAddresses = [
...baseAddresses.map((address) => decodeAddressLabel(address, hasAddressLabel)),
...consignmentAddresses,
];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const consignmentAddresses =
shouldIncludeConsignmentAddresses && consignments
? getConsignmentAddressOptions(consignments, baseAddresses).map((address) =>
decodeAddressLabel(address, hasAddressLabel),
)
: [];
const billingAddresses = [
...baseAddresses.map((address) => decodeAddressLabel(address, hasAddressLabel)),
...consignmentAddresses,
];
const consignmentAddresses =
shouldIncludeConsignmentAddresses && consignments
? getConsignmentAddressOptions(consignments, baseAddresses)
: [];
const billingAddresses = [
...baseAddresses,
...consignmentAddresses,
].map((address) => decodeAddressLabel(address, hasAddressLabel));

💅

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. cac906e 🙇🏻‍♂️

@bc-peng
bc-peng merged commit 242dc51 into master Nov 11, 2026
11 checks passed
@bc-peng
bc-peng deleted the BILLING-ADDRESS-PLUS branch November 11, 2026 03:16
@bc-launchbay

Copy link
Copy Markdown

checkout-js deployed to Integration US
success 20261111032731 by Launchbay

@bc-launchbay

Copy link
Copy Markdown

checkout-js deployed to Staging US
success 20261111032731 by Launchbay

@github-actions

Copy link
Copy Markdown

⚡️ Lighthouse results

🖥️ Desktop:

Category Score
🟢 Performance 97
🟢 Accessibility 96
🟠 Best practices 81

📱 Mobile:

Category Score
🟠 Performance 80
🟢 Accessibility 96
🟠 Best practices 81

@bc-launchbay

Copy link
Copy Markdown

checkout-js deployed to Production US
success 20261111032731 by Launchbay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants